# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libosinfo
pkgver=1.8.0
pkgrel=0
pkgdesc="A library for managing OS information for virtualization"
url="https://libosinfo.org/"
arch="all"
license="LGPL-2.0-or-later"
depends="hwids osinfo-db"
makedepends="
	meson
	glib-dev
	libsoup-dev
	libxml2-dev
	libxslt-dev
	gobject-introspection-dev
	vala
	perl
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
source="https://gitlab.com/libosinfo/libosinfo/-/archive/v$pkgver/libosinfo-v$pkgver.tar.gz"
builddir="$srcdir/libosinfo-v$pkgver"

# secfixes:
#   1.5.0-r1:
#     - CVE-2019-13313

build() {
	meson \
		--prefix=/usr \
		--buildtype=plain \
		-Denable-gtk-doc=false \
		-Denable-introspection=enabled \
		-Denable-tests=true \
		-Denable-vala=enabled \
		-Dwith-pci-ids-path=/usr/share/hwdata/pci.ids \
		-Dwith-usb-ids-path=/usr/share/hwdata/usb.ids \
		. output
	ninja -C output
}

check() {
	ninja -C output test
}

package() {
	DESTDIR="$pkgdir" ninja -C output install
}

sha512sums="ac4f7bc7a5bb937e8569a0b66575044c41cf6b8d5f4555f90a48ba64712c0f88cb22e152dff7440d71d48c6a1528069c16fee7a86ebe9d3731f9f16d97236c20  libosinfo-v1.8.0.tar.gz"
